package br.com.infocruz.seam.crm.ejb.session;

import br.com.infocruz.seam.crm.ejb.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("companyHome")
public class CompanyHome extends EntityHome<Company> {

	public void setCompanyId(Long id) {
		setId(id);
	}

	public Long getCompanyId() {
		return (Long) getId();
	}

	@Override
	protected Company createInstance() {
		Company company = new Company();
		return company;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Company getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
